<?php
// +----------------------------------------------------------------------
// | EtrolPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Author: HCZ<huangchengze@etrol.com> 
// +----------------------------------------------------------------------

namespace app\basic\model;
use app\common\model\Base;

/**
 * 危险源
 */
class Dangersource extends Base{

	protected $name = "dangersource";
	protected $createTime = 'createTime';
	protected $updateTime = 'updateTime';
	
	public function  setSourceTypeAttr(){
		return $this->sourceType;
	}
	
	public function enterprise(){
		return $this->hasOne('Enterprise','id','enterpriseId');
	}
	
	public function staff() {
		return $this->hasOne('Staff','id','chargePerson');
	}
	
	public function  sensors() {
		return $this->hasMany('app\common\model\Sensor','dangerSourceId','id');
	}
}